package cn.iocoder.yudao.module.system.dal.mysql.qnaApplication;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;

import cn.iocoder.yudao.module.system.controller.admin.application.vo.ApplicationPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.qnaApplication.vo.QnaApplicationPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.qnaApplication.QnaApplicationDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 需求申请 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface QnaApplicationMapper extends BaseMapperX<QnaApplicationDO> {

    default PageResult<QnaApplicationDO> selectPage(QnaApplicationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<QnaApplicationDO>()
                .eqIfPresent(QnaApplicationDO::getApplicationTitle, reqVO.getApplicationTitle())
                .eqIfPresent(QnaApplicationDO::getApplicationReason, reqVO.getApplicationReason())
                .eqIfPresent(QnaApplicationDO::getApplicationScenario, reqVO.getApplicationScenario())
                .eqIfPresent(QnaApplicationDO::getUseTimeStart, reqVO.getUseTimeStart())
                .eqIfPresent(QnaApplicationDO::getUseTimeEnd, reqVO.getUseTimeEnd())
                .eqIfPresent(QnaApplicationDO::getContactPhone, reqVO.getContactPhone())
                .eqIfPresent(QnaApplicationDO::getContactAddress, reqVO.getContactAddress())
                .eqIfPresent(QnaApplicationDO::getServiceScope, reqVO.getServiceScope())
                .eqIfPresent(QnaApplicationDO::getExpectedEffect, reqVO.getExpectedEffect())
                .likeIfPresent(QnaApplicationDO::getSystemName, reqVO.getSystemName())
                .eqIfPresent(QnaApplicationDO::getDeploymentLocation, reqVO.getDeploymentLocation())
                .eqIfPresent(QnaApplicationDO::getSystemIp, reqVO.getSystemIp())
                .eqIfPresent(QnaApplicationDO::getSystemUrl, reqVO.getSystemUrl())
                .eqIfPresent(QnaApplicationDO::getLevelProtectionCode, reqVO.getLevelProtectionCode())
                .eqIfPresent(QnaApplicationDO::getLevelProtectionLevel, reqVO.getLevelProtectionLevel())
                .eqIfPresent(QnaApplicationDO::getReplyContent, reqVO.getReplyContent())
                .betweenIfPresent(QnaApplicationDO::getReplyTime, reqVO.getReplyTime())
                .eqIfPresent(QnaApplicationDO::getStatus, reqVO.getStatus())
                .eqIfPresent(QnaApplicationDO::getCreateId, reqVO.getCreateId())
                .betweenIfPresent(QnaApplicationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(QnaApplicationDO::getApplicationScenario));
    }

}